package com.fk.regimen;

import java.util.ArrayList;
import java.util.List;

import com.fk.adapter.FoodDetailAdapter;
import com.fk.bean.Food;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.widget.ListView;

//推荐吃什么水果
public class IntroFoodListActivity extends Activity {
	
	
	private ListView lv_foodDetail;
	//每一行的数据
	List<Food> list = new ArrayList<Food>();
	//声明LayoutInflater
	LayoutInflater mInflater;
	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.introfoodlist);
		
		
		mInflater = LayoutInflater.from(this);
		lv_foodDetail = (ListView) findViewById(R.id.lv_foodDetail);
		
		
		getData();
		//调用适配器
		FoodDetailAdapter foodDetailAdapter = new FoodDetailAdapter(list, IntroFoodListActivity.this);
		lv_foodDetail.setAdapter(foodDetailAdapter);
		
	}


	//获取服务端数据
	private void getData() {
		// TODO Auto-generated method stub
		
		//先模拟数据
		Food food1 = new Food("菠萝","食物功效是啥嘞？","如何选购呢？","食材详情？","食性？","还有禁忌",1,R.drawable.ic_launcher,"食物介绍");
		Food food2 = new Food("草莓","食物功效是啥嘞2？","如何选购呢？","食材详情？","食性？","还有禁忌",1,R.drawable.ic_launcher,"食物介绍");
		Food food3 = new Food("梨子","食物功效是啥嘞3？","如何选购呢？","食材详情？","食性？","还有禁忌",1,R.drawable.ic_launcher,"食物介绍");
		Food food4 = new Food("樱桃","食物功效是啥嘞4？","如何选购呢？","食材详情？","食性？","还有禁忌",1,R.drawable.ic_launcher,"食物介绍");
		Food food5 = new Food("山楂","食物功效是啥嘞5？","如何选购呢？","食材详情？","食性？","还有禁忌",1,R.drawable.ic_launcher,"食物介绍");
		
		list.add(food1);
		list.add(food2);
		list.add(food3);
		list.add(food4);
		list.add(food5);
	}
	
	

}
